package com.da.springtest.condition.test2;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Conditional;
import org.springframework.context.annotation.Configuration;

/**
 * @author chenlida
 * @date 2020/6/22 15:01
 * @description
 */
@Configuration
public class BeanConfig {
    @Conditional(OnMissingBeanCondition.class)
    @Bean
    public IService service1() {
        return new Service1();
    }

    @Conditional(OnMissingBeanCondition.class)
    @Bean
    public IService service2() {
        return new Service2();
    }
}
